package DAO;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import javax.swing.JOptionPane;

public class javaconnect {

    Connection conn = null;

    public static Connection connectDB() throws ClassNotFoundException {

        try {
            Class.forName("com.mysql.jdbc.Driver");
            Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/nrl", "root", "");
            return conn;
        } catch (SQLException e) {
            JOptionPane.showMessageDialog(null, "Can't connect to Database");
            return null;
        }
    }

}
